<html><head><title>DisableToolBarButton</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">DisableToolBarButton()</font></b></p>
<p><b>Syntax</b></p><blockquote>
<font color="#006666"><b>DisableToolBarButton</b></font>(#ToolBar, Button, State)</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Disable (or enable) a toolbar button in the given toolbar. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#ToolBar</i></td>
<td width="90%"> 
The toolbar to use. 

</td></tr>
<tr><td><i>Button</i></td>
<td> 
The toolbar button to disable or enable. 

</td></tr>
<tr><td><i>State</i></td>
<td> 
The new state for the toolbar button. A value of 1 disables 
the toolbar button and a value of 0 enables it. 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>
None.


</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">If</font></b> <font color="#006666">OpenWindow</font>(0, 0, 0, 150, 60, "ToolBar", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
    <b><font color="#006666">If</font></b> <font color="#006666">CreateToolBar</font>(0,<font color="#006666"> WindowID</font>(0))
<font color="#006666">      ToolBarStandardButton</font>(0, <font color="#924B72">#PB_ToolBarIcon_New</font>)
<font color="#006666">      ToolBarStandardButton</font>(1, <font color="#924B72">#PB_ToolBarIcon_Open</font>)
<font color="#006666">      ToolBarStandardButton</font>(2, <font color="#924B72">#PB_ToolBarIcon_Save</font>)
<font color="#006666">      DisableToolBarButton</font>(0, 1, 1) : Disabled = <font color="#924B72">#True</font>
    <b><font color="#006666">EndIf</font></b>

<font color="#006666">    ButtonGadget</font>(0, 20, 30, 110, 20, "Enable OpenFile")

    <b><font color="#006666">Repeat</font></b>
      Event =<font color="#006666"> WaitWindowEvent</font>()
      <b><font color="#006666">If</font></b> Event = <font color="#924B72">#PB_Event_Gadget</font>
        <b><font color="#006666">If</font></b> <font color="#006666">EventGadget</font>() = 0
          <b><font color="#006666">If</font></b> Disabled = <font color="#924B72">#True</font>
<font color="#006666">            DisableToolBarButton</font>(0, 1, 0)
<font color="#006666">            SetGadgetText</font>(0,"Disable OpenFile")
            Disabled = <font color="#924B72">#False</font>
          <b><font color="#006666">Else</font></b>
<font color="#006666">            DisableToolBarButton</font>(0, 1, 1)
<font color="#006666">            SetGadgetText</font>(0,"Enable OpenFile")
            Disabled = <font color="#924B72">#True</font>
          <b><font color="#006666">EndIf</font></b>
        <b><font color="#006666">EndIf</font></b>
      <b><font color="#006666">EndIf</font></b>
    <b><font color="#006666">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font> 
  <b><font color="#006666">EndIf</font></b>
</font></pre>
<br>
<p><img src="../HelpPictures/disabletoolbarbutton.png"></p>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="toolbarstandardbutton.html">ToolBarStandardButton()</a>, <a href="toolbarimagebutton.html">ToolBarImageButton()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=createtoolbar.html>CreateToolBar()</a> - <a href=index.html>ToolBar Index</a> - <a href=freetoolbar.html>FreeToolBar()</a> ->

</body></html>